home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Examples
/
More Examples
/
Using performance fields
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-26
|
2KB
|
64 lines
;;; Basic Example
; You start defining the density vectors for each dimension, for
; example here you use sine waves to build the 3d density space.
; You can freely use any generator output here, like brownian noise,
; fractals, and others for different dimensions. For more dimensions
; than 3 just extend the parameter list.
(setq 3dspace
(make-density-space
(gen-sin 1 1 256) ;x
(gen-sin 2 1 256) ;y
(gen-sin 3 1 256))) ;z
; Next you fly through this space. In this example you are using a
; path which x, y and z points each follow sine 0.1, 0.2 and 0.3 waves.
; Probe is :linear, and just sums the density values. The results are
; scaled to velocity ranges 55 .. 127.
(setq velocity-density
(vector-round 55 127
(fly-through 3dspace :linear
(vector-round 0 255 (gen-sin 0.1 1 256 -45))
(vector-round 0 255 (gen-sin 0.2 1 256 +45))
(vector-round 0 255 (gen-sin 0.3 1 256)))))
; Make another fly and scale the densities to symbol range a to z.
(setq melody
(vector-to-symbol a z
(fly-through 3dspace :linear
(vector-round 0 255 (gen-sin 2 1 256 -45))
(vector-round 20 255 (gen-sin 2.2 1 256 +45))
(vector-round 40 255 (gen-sin 3.3 1 256)))))
; Then make a motive of these values with steady rhythm and let
; them play in equal-tempered 24 tone octave. Second melody plays
; all theme components reversed.
(def-section sect-a
default
zone (* (get-tick '1/16) (length melody))
tonality (activate-tonality (equal-tempered 48 'c 4 4024))
motive (def-motive theme
length '(1/16)
symbol melody
velocity (vector-to-list velocity-density))
piano1
channel 1
motive theme
piano2
channel 2
motive (rev theme)
)
(def-tempo 80)
(midiport :printer)
(play-file-p "density fly"
piano1 '(sect-a)
piano2 '(sect-a)
)